package com.ruoyi.project.mgcmanage.service.impl;

import com.ruoyi.project.mgcmanage.domain.Medicine;
import com.ruoyi.project.mgcmanage.mapper.MedicineMapper;
import com.ruoyi.project.mgcmanage.service.IMedicineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MedicineServiceImpl implements IMedicineService {
    @Autowired
    private MedicineMapper medicineMapper;

    @Override
    public List<Medicine> selectAll(Medicine medicine) {
        return medicineMapper.selectAll(medicine);
    }

    @Override
    public int addMedicine(Medicine medicine) {
        return medicineMapper.insert(medicine);
    }

    @Override
    public Medicine getById(int mid) {
        return medicineMapper.getById(mid);
    }

    @Override
    public int updateMedicine(Medicine medicine) {
        return medicineMapper.update(medicine);
    }

    @Override
    public int deleteMedicine(int[] mids) {
        return medicineMapper.delete(mids);
    }
}
